{extend name='admin@main'}

{block name="button"}
{if auth("admin/drawRecord/remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" class='layui-btn layui-btn-sm layui-btn-primary'>删除抽奖记录</button>
{/if}
{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='draw_record/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>用户</th>
            <th class='text-left nowrap'>标题</th>
            <th class='text-left nowrap'>图片</th>
            <th class='text-left nowrap'>类型</th>
            <th class='text-left nowrap'>时间</th>
            <th></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <td class='text-left nowrap'>
                {$vo.username|default='--'}
            </td>
            <td class='text-left nowrap'>
                {$vo.title|default='--'}
            </td>
            <td class='text-left nowrap'>
                {notempty name='vo.img'}
                <img data-tips-image style="width:50px;height:50px" src="{$vo.img|default=''}" class="margin-right-5 text-top">
                {/notempty}
            </td>
            <td class='text-left nowrap'>
                {if $vo.dtype == 1}
                <span class="color-green">实物</span><br/>
                {/if}
                {if $vo.dtype == 2}
                <span class="color-red">现金</span><br/>
                {/if}
                {if $vo.dtype == 3}
                <span class="color-desc">未中奖</span>
                {/if}
            </td>
            <td class='text-left nowrap'>
                {$vo.time|default='--'}
            </td>
            <td class='text-left nowrap'>
                <div class="nowrap margin-bottom-5">
                    {if auth("admin/drawRecord/remove")}
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除抽奖记录吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                    {else}
                    <a data-tips-text="您没有删除抽奖记录的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">删 除</a>
                    {/if}

                </div>

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
{/block}
